<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInLeft">
    <div data-th-replace="common/functionDepict"></div>
    <div>
        <div class="row">
            <div class="pt10">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>填写基本信息</h5>
                        </div>
                        <form id="saveGroomPlaceFrom">
                            <div class="ibox-content">
                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"> 推荐位置名称</label>
                                        <div class="col-sm-8">
                                            <p class="form-control-static" th:text="${groomPlace['placeName']}"><small class="fs12 c-999"></small></p>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group" th:if="${groomPlace['dataType']}!=null and ${groomPlace['dataType']}!='' and ${groomPlace['groomDataList']}!=null">
                                        <label class="col-sm-2 control-label text-right">
                                            <span th:if="${groomPlace['dataType']}=='COURSE'">推荐课程</span>
                                            <span th:if="${groomPlace['dataType']}=='USER'">推荐学员</span>
                                            <span th:if="${groomPlace['dataType']}=='TEACHER'">推荐讲师</span>
                                            <span th:if="${groomPlace['dataType']}=='ARTICLE'">推荐新闻资讯</span>
                                            <span th:if="${groomPlace['dataType']}=='BOOK'">推荐图书</span>
                                            <span th:if="${groomPlace['dataType']}=='PACKAGE'">推荐套餐</span>
                                            <span th:if="${groomPlace['dataType']}=='LIVE'">推荐直播</span>
                                            <span th:if="${groomPlace['dataType']}=='SMALL'">推荐小班课</span>
                                        </label>
                                        <div class="col-sm-9">
                                            <p>
                                                <button th:if="${groomPlace['dataType']}=='COURSE'" class="btn btn-primary selectData"  th:attr="data-type=${groomPlace['dataType']}"  type="button"><i class="fa fa-plus"></i> &nbsp;选择课程</button>
                                                <button th:if="${groomPlace['dataType']}=='USER'" class="btn btn-primary selectData"  th:attr="data-type=${groomPlace['dataType']}" type="button"><i class="fa fa-plus"></i> &nbsp;选择学员</button>
                                                <button th:if="${groomPlace['dataType']}=='TEACHER'" class="btn btn-primary selectData"  th:attr="data-type=${groomPlace['dataType']}" type="button"><i class="fa fa-plus"></i> &nbsp;选择讲师</button>
                                                <button th:if="${groomPlace['dataType']}=='ARTICLE'" class="btn btn-primary selectData"  th:attr="data-type=${groomPlace['dataType']}" type="button"><i class="fa fa-plus"></i> &nbsp;选择新闻资讯</button>
                                                <button th:if="${groomPlace['dataType']}=='BOOK'" class="btn btn-primary selectData"  th:attr="data-type=${groomPlace['dataType']}" type="button"><i class="fa fa-plus"></i> &nbsp;选择图书</button>
                                                <button th:if="${groomPlace['dataType']}=='PACKAGE'" class="btn btn-primary selectData"  th:attr="data-type=${groomPlace['dataType']}" type="button"><i class="fa fa-plus"></i> &nbsp;选择套餐</button>
                                                <button th:if="${groomPlace['dataType']}=='LIVE'" class="btn btn-primary selectData"  th:attr="data-type=${groomPlace['dataType']}" type="button"><i class="fa fa-plus"></i> &nbsp;选择直播</button>
                                                <button th:if="${groomPlace['dataType']}=='SMALL'" class="btn btn-primary selectData"  th:attr="data-type=${groomPlace['dataType']}" type="button"><i class="fa fa-plus"></i> &nbsp;选择小班课</button>
                                            </p>
                                            <div id="groomData" class="pt10" th:classappend="${#lists.isEmpty(groomPlace['groomDataList'])} ?'hide':''">
                                                <table class="table table-bordered table-hover">
                                                    <thead>
                                                    <tr>
                                                        <th class="text-center">ID</th>
                                                        <th class="text-center">名称</th>
                                                        <th class="text-center">操作</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody id="data-content">
                                                        <tr th:if="!${#lists.isEmpty(groomPlace['groomDataList'])}"  th:each="groomData,index:${groomPlace['groomDataList']}" th:attr="data-id=${groomData['dataTypeMap']['id']},data-sort=${index.count}">
                                                            <td class="text-center" th:text="${groomData['dataTypeMap']['id']}"></td>
                                                            <td class="text-center">
                                                                <span th:if="${groomPlace['dataType']}=='COURSE'" th:text="${groomData['dataTypeMap']['courseName']}"></span>
                                                                <span th:if="${groomPlace['dataType']}=='USER'" th:text="${groomData['dataTypeMap']['nickname']}"></span>
                                                                <span th:if="${groomPlace['dataType']}=='TEACHER'" th:text="${groomData['dataTypeMap']['teacherName']}"></span>
                                                                <span th:if="${groomPlace['dataType']}=='ARTICLE'" th:text="${groomData['dataTypeMap']['title']}"></span>
                                                                <span th:if="${groomPlace['dataType']}=='BOOK'" th:text="${groomData['dataTypeMap']['bookName']}"></span>
                                                                <span th:if="${groomPlace['dataType']}=='PACKAGE'" th:text="${groomData['dataTypeMap']['courseName']}"></span>
                                                                <span th:if="${groomPlace['dataType']}=='LIVE'" th:text="${groomData['dataTypeMap']['courseName']}"></span>
                                                                <span th:if="${groomPlace['dataType']}=='SMALL'" th:text="${groomData['dataTypeMap']['courseName']}"></span>
                                                            </td>
                                                            <td class="text-center">
                                                                <a href="javascript:void(0);" class="c-master fs14 ml5 deleteData" data-toggle="tooltip" data-placement="bottom" data-original-title="删除"><i class="fa fa-trash"></i></a>
                                                                <a th:classappend="${index.first}?'hide':''" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="上移"><i class="fa fa-arrow-up"></i></a>
                                                                <a th:classappend="${index.last}?'hide':''" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="top" data-original-title="下移"><i class="fa fa-arrow-down"></i></a>
                                                            </td>
                                                        </tr>
                                                        <input type="hidden" name="dataIds" />
                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"  th:if="${groomPlace['dataType']}!=null and ${groomPlace['dataType']}!='' and ${groomPlace['groomDataList']}!=null"></div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"> 推荐限制数量</label>
                                        <div class="col-sm-8">
                                            <p class="form-control-static" th:text="${groomPlace['groomNum']}"><small class="fs12 c-999"></small></p>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">  推荐位置描述</label>
                                        <div class="col-sm-10">
                                            <p class="form-control-static" th:text="${groomPlace['depict']}"><small class="fs12 c-999"></small></p>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <input name="id" th:value="${groomPlace['id']}" type="hidden">
                                    <input name="dataType" th:value="${groomPlace['dataType']}"  type="hidden"/>
                                    <input type="hidden" name="groomNum" th:value="${groomPlace['groomNum']}" />
                                    <input name="placeKey" th:value="${groomPlace['placeKey']}"  type="hidden"/>
                                    <div class="form-group">
                                        <div th:if="${status}==2" class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-danger" id="submitGroomData" type="button">保存</button>
                                            <button class="btn btn-white ml10" id="onBack" type="button">取消</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div data-th-replace="layout/head-footer"></div>
<script type="text/javascript" th:src="@{{path}/admin/business/op/article/select-common-article.js?v={v}(path=${staticPath},v=${v})}"></script>
<script type="text/javascript" th:src="@{{path}/admin/business/manage/teacher/common-select-teacher-list.js?v={v}(path=${staticPath},v=${v})}"></script>
<script type="text/javascript" th:src="@{{path}/admin/business/course/cou/select-common-course.js?v={v}(path=${staticPath},v=${v})}"></script>
<script type="text/javascript" th:src="@{{path}/admin/business/course/cou/packageCou/select-common-package.js?v={v}(path=${staticPath},v=${v})}"></script>
<script type="text/javascript" th:src="@{{path}/admin/business/course/book/select_common_book.js?v={v}(path=${staticPath},v=${v})}"></script>
<script type="text/javascript" th:src="@{{path}/admin/business/user/user/select_common_user.js?v={v}(path=${staticPath},v=${v})}"></script>
<script type="text/javascript" th:src="@{{path}/admin/business/op/groom/groomPlace_Info.js?v={v}(path=${staticPath},v=${v})}"></script>
</body>
</html>
